import { Column, Table } from '@zxhhyj/storm'

export interface Playlist {
  id?: number
  name: string
  createDateTime: Date
}

class PlaylistTable extends Table<Playlist> {
  override readonly tableName: string = 't_playlist'
  readonly id = Column.integer('id').primaryKey(true).bindTo(this, 'id')
  readonly name = Column.text('name').notNull().bindTo(this, 'name')
  readonly createDateTime = Column.timestamp('create_datetime').notNull().bindTo(this, 'createDateTime')
}

export const playlistTable = new PlaylistTable()